﻿using AnlianCommon.Common.DTO;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SheepCommon.API.SheepFarmHomepage.BreedingHenStock;
using SheepCommon.API.SheepFarmHomepage.RealTimeStorage;

namespace SheepCommon.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class SheepFarmHomepagesController : ControllerBase
    {
        private readonly IMediator _mediator;

        public SheepFarmHomepagesController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 羊场实时存栏种公种母后裔
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> RealTimeStorageQuery(RealTimeStorageQueryCommand request, CancellationToken cancellationToken)
        {
            var reseult = await _mediator.Send(request);
            return reseult;
        }
        /// <summary>
        /// 羊场总存栏
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> RealTimeStorageSumQuery(RealTimeStorageSumQueryCommand request, CancellationToken cancellationToken)
        {
            var result =await _mediator.Send(request);
            return result;
        }
        /// <summary>
        /// 种母存栏结果
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Result> BreedingHenStockQuery(BreedingHenStockQueryCommand request, CancellationToken cancellationToken)
        {
            var result = await _mediator.Send(request);
            return result;
        }
    }
}
